package com.zmn.oms.model.entity.work;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.zmn.common.dictionary.GlobalDict;
import com.zmn.consts.GlobalConsts;
import com.zmn.oms.model.es.ZmnEsFieldType;
import com.zmn.oms.model.es.ZmnToEs;
import com.zmn.pay.common.constant.PayConsts;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

/**
 * 类描述： 查询工单
 *
 * @author lujia
 * @date 2018/11/23 20:01
 */
@Data
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class OrderWorkQuery extends OrderBaseEsQuery {

    /**
     *  tab 类型workStatusList
     */
    private Integer tabType;

    /**
     * id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ZmnToEs(map = "id", type = ZmnEsFieldType.Long)
    private Long id;

    /**
     * orderIdList
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ZmnToEs(map = "id", type = ZmnEsFieldType.Arr)
    private List<Long> orderIdList;

    /**
     * orderId 订单id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ZmnToEs(map = "orderId", type = ZmnEsFieldType.Long)
    private Long orderId;

    /**
     * orderId 订单id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ZmnToEs(map = "orderId", type = ZmnEsFieldType.NotIn)
    private Long nonOrderId;

    /**
     * 工单状态
     */
    @ZmnToEs(map = "status", type = ZmnEsFieldType.Arr)
    private List<Integer> workStatus;
    @ZmnToEs(map = "status", type = ZmnEsFieldType.Arr)
    private List<Integer> workCancelResultStatus;

    /**
     * 工单状态List
     */
    @ZmnToEs(map = "status", type = ZmnEsFieldType.Arr)
    private List<Integer> workStatusList;

    @ZmnToEs(map = "status", type = ZmnEsFieldType.Arr)
    private List<Integer> workCancelStatusList;

    /**
     * 工单状态范围
     */
    @ZmnToEs(map = "status", type = ZmnEsFieldType.IntegerRange)
    private String workStatusRange;

    /**
     * 工单结果状态
     */
    @ZmnToEs(map = "resultStatus", type = ZmnEsFieldType.Integer)
    private Integer workResultStatus;

    /**
     * 工单结果状态列表
     */
    @ZmnToEs(map = "resultStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> workResultStatusList;

    /**
     * 工单金额审核状态
     */
    @ZmnToEs(map = "amountReviewStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> amountReviewStatus;

    /**
     * 用户电话
     */
    //@ZmnToEs(map = {"contact.queryPhone", "contact.phoneEnd4"}, type = ZmnEsFieldType.Or)
    private String concatPhone;

    /**
     * 查询用户电话对应的用户ID
     */
    private Boolean queryConcatPhoneUsers;

    /**
     * 加密手机号
     */
    private String cryptoPhone;

    /**
     * 用户电话
     */
    //@ZmnToEs(map = "contact.queryPhone", type = ZmnEsFieldType.Arr)
    private List<String> concatPhoneList;

    /**
     * 小号电话
     */
    @ZmnToEs(map = {"contact.bindPhone", "contact.bindPhoneEnd4"}, type = ZmnEsFieldType.Or)
    private String bindPhone;

    /**
     * 小号电话
     */
    @ZmnToEs(map = "contact.bindPhone", type = ZmnEsFieldType.Arr)
    private List<String> bindPhoneList;

    /**
     * 联系用户姓名
     */
    @ZmnToEs(map = {"contact.userName", "contact.contactName"}, type = ZmnEsFieldType.Or)
    private String concatUserName;

    /**
     * 客户类型
     * @see GlobalDict#getUserTypeList()
     */
    @ZmnToEs(map = "userType", type = ZmnEsFieldType.Integer)
    private Integer userType;

    /**
     * 派单模式：10平台直派，20服务商派单
     */
    @ZmnToEs(map = "distributeWay", type = ZmnEsFieldType.Integer)
    private Integer distributeWay;

    /**
     * 是否待派单
     */
    private Boolean isWaitDistribute;

    /**
     * 抢单类型：1指派，2抢单
     */
    @ZmnToEs(map = "grabType", type = ZmnEsFieldType.Integer)
    private Integer grabType;

    @ZmnToEs(map = "grabType", type = ZmnEsFieldType.NotIn)
    private Integer nonGrabType;

    /**
     * 抢单状态：1已发放，2已抢单
     */
    private Integer grabStatus;

    /**
     * 是否要客：1不是vvip，2是vvip
     */
    @ZmnToEs(map = "vvip", type = ZmnEsFieldType.Integer)
    private Integer vvip;

    /**
     * 如果vvip等于1，则把这个设为2，es查询不等于2的所有工单。兼容以前工单数据。
     */
    @ZmnToEs(map = "vvip", type = ZmnEsFieldType.NotIn)
    private Integer vip;

    /**
     * 用户Id
     */
    @ZmnToEs(map = "userId", type = ZmnEsFieldType.Long)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /**
     * userIdList
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ZmnToEs(map = "userId", type = ZmnEsFieldType.Arr)
    private List<Long> userIdList;

    /**
     * notUserIdList
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ZmnToEs(map = "userId", type = ZmnEsFieldType.NotInArr)
    private List<Long> notUserIdList;

    /**
     * 第三方订单用户Id
     */
    @ZmnToEs(map = "contact.outerUserId", type = ZmnEsFieldType.Text)
    private String outerUserId;

    /**
     * 工单类型
     * @see com.zmn.oms.common.constant.OrderConsts#getOrderWorkTypeList()
     */
    @ZmnToEs(map = "type", type = ZmnEsFieldType.Integer)
    private Integer singleWorkType;

    /**
     * 工单类型
     * @see com.zmn.oms.common.constant.OrderConsts#getOrderWorkTypeList()
     */
    @ZmnToEs(map = "type", type = ZmnEsFieldType.Arr)
    private List<Integer> workType;

    /**
     * 工单类型
     * @see com.zmn.oms.common.constant.OrderConsts#getOrderWorkTypeList()
     */
    @ZmnToEs(map = "type", type = ZmnEsFieldType.Arr)
    private List<Integer> workTypeList;

    /**
     * 详细地址
     */
    //@ZmnToEs(map = "contact.queryFullAddress", type = ZmnEsFieldType.Like)
    private String concatAddress;

    /**
     * 故障内容
     */
    @ZmnToEs(map = "faultContent", type = ZmnEsFieldType.Text)
    private String faultContent;

    /**
     * 啄木鸟省份Id
     */
    @ZmnToEs(map = "provinceId", type = ZmnEsFieldType.Integer)
    private Integer provinceId;

    /**
     * 省份IdList
     */
    @ZmnToEs(map = "provinceId", type = ZmnEsFieldType.Arr)
    private List<Integer> provinceIdList;

    /**
     * 工单城市
     */
    @ZmnToEs(map = "cityId", type = ZmnEsFieldType.Arr)
    private List<Integer> cityIdList;

    /**
     * 工程师Id
     */
    @ZmnToEs(map = "masterId", type = ZmnEsFieldType.Integer)
    private Integer masterId;

    /**
     * 责任工程师Id 查询需要特殊处理
     */
    // @ZmnToEs(map = "cancelLiableMasterId", type = ZmnEsFieldType.Integer)
    private Integer cancelLiableMasterId;

    /**
     * 工程师Id（不等于）
     */
    @ZmnToEs(map = "masterId", type = ZmnEsFieldType.NotIn)
    private Integer nonMasterId;

    /**
     * 工程师主管
     */
    @ZmnToEs(map = "masterSupervisorId", type = ZmnEsFieldType.Integer)
    private Integer masterSupervisorId;

    /**
     * 工单多工程师Id
     */
    @ZmnToEs(map = "masterList.masterId", path = "masterList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Integer)
    private Integer multiMasterId;

    /**
     * 工程师类型
     */
    @ZmnToEs(map = "masterList.masterType", path = "masterList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Integer)
    private Integer masterType;

    /**
     * 多工程师分润
     */
    @ZmnToEs(map = "masterList.shareRate", path = "masterList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Boolean)
    private Integer shareRate;

    /**
     * 是否是多工程师 1 no 2 yes
     */
    @ZmnToEs(map = "isMultiMaster", type = ZmnEsFieldType.Boolean)
    private Integer multiMaster;

    /**
     * 工单区县
     */
    @ZmnToEs(map = "countyId", type = ZmnEsFieldType.Arr)
    private List<Integer> countyIdList;

    /**
     * 是否重复的工单 1 no 2 yes
     */
    @ZmnToEs(map = "isDuplicate", type = ZmnEsFieldType.Boolean)
    private Integer duplicate;

    /**
     * 跟单类型id
     */
    @ZmnToEs(map = "trackList.trackTypeId", path = "trackList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Arr)
    private List<Integer> trackTypeId;

    /**
     * 跟单状态
     */
    @ZmnToEs(map = "trackStatus", type = ZmnEsFieldType.Integer)
    private Integer trackStatus;

    /**
     * 跟单等级
     */
    @ZmnToEs(map = "trackList.trackLevel", path = "trackList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Integer)
    private Integer trackLevel;

    /**
     * 服务分类集合
     */
    @ZmnToEs(map = "servCategId", type = ZmnEsFieldType.Arr)
    private List<Integer> servCategId;

    /**
     * 服务分类（单个）
     */
    @ZmnToEs(map = "servCategId", type = ZmnEsFieldType.Integer)
    private Integer serviceCategoryId;

    /**
     * 产品分组
     */
    @ZmnToEs(map = "servProductGroupId", type = ZmnEsFieldType.Arr)
    private List<Integer> servProductGroupIdList;

    /**
     * 产品一级分类id
     */
    @ZmnToEs(map = "categOneId", type = ZmnEsFieldType.Arr)
    private List<Integer> categOneIdList;

    /**
     * 产品二级分类id
     */
    @ZmnToEs(map = "categTwoId", type = ZmnEsFieldType.Arr)
    private List<Integer> categTwoIdList;

    /**
     * 前台产品一级分类id
     */
    @ZmnToEs(map = "showCategOneId", type = ZmnEsFieldType.Arr)
    private List<Integer> showCategOneIdList;

    /**
     * 前台产品二级分类id
     */
    @ZmnToEs(map = "showCategTwoId", type = ZmnEsFieldType.Arr)
    private List<Integer> showCategTwoIdList;

    /**
     * 产品id
     */
    @ZmnToEs(map = "productId", type = ZmnEsFieldType.Integer)
    private Integer productId;

    /**
     * 前台产品id
     */
    @ZmnToEs(map = "showProductId", type = ZmnEsFieldType.Integer)
    private Integer showProductId;

    /**
     * 前台产品id集合
     */
    @ZmnToEs(map = "showProductId", type = ZmnEsFieldType.Arr)
    private List<Integer> showProductIdList;

    /**
     * 厂商产品id
     */
    @ZmnToEs(map = "factoryOrder.productId", type = ZmnEsFieldType.Integer)
    private Integer fcProductId;

    /**
     * 产品id集合
     */
    @ZmnToEs(map = "productId", type = ZmnEsFieldType.Arr)
    private List<Integer> productIdList;

    /**
     * 产品品牌id
     */
    @ZmnToEs(map = "brandId", type = ZmnEsFieldType.Integer)
    private Integer brandId;

    /**
     * 是否回访 1 no 2 yes
     */
    @ZmnToEs(map = "isReply", type = ZmnEsFieldType.Boolean)
    private Integer replyVisited;

    /**
     * 业务类型
     */
    @ZmnToEs(map = "bizType", type = ZmnEsFieldType.Integer)
    private Integer bizType;

    /**
     * 业务模式：1平台，自营
     * @see GlobalConsts#BIZ_MODE_PLAT
     */
    @ZmnToEs(map = "bizMode", type = ZmnEsFieldType.Integer)
    private Integer bizMode;

    /**
     * 下单业务模式：1平台，自营
     * @see GlobalConsts#BIZ_MODE_PLAT
     */
    @ZmnToEs(map = "bizModeSource", type = ZmnEsFieldType.Integer)
    private Integer bizModeSource;

    /**
     * 保单号(老的字段)
     */
    // @ZmnToEs(map = "warrantyCode", type = ZmnEsFieldType.Text)
    private String warrantyCode;

    /**
     * 保修卡号 新保修逻辑
     */
    // @ZmnToEs(map = "warrantyCodes", type = ZmnEsFieldType.Arr)
    private List<String> warrantyCodes;

    /**
     * 优惠券code
     */
    @ZmnToEs(map = "couponCode", type = ZmnEsFieldType.Text)
    private String couponCode;

    /**
     * 是否开发票 1 no 2 yes
     */
    @ZmnToEs(map = "hasInvoice", type = ZmnEsFieldType.Boolean)
    private Integer hasInvoice;

    /**
     * 是否有定金  1 no 2 yes
     */
    @ZmnToEs(map = "hasDeposit", type = ZmnEsFieldType.Boolean)
    private Integer hasDeposit;

    /**
     * 是否在服务范围 1 no 2 yes
     */
    @ZmnToEs(map = "inScopeService", type = ZmnEsFieldType.Boolean)
    private Integer inScopeService;

    /**
     * 操作
     */
    @ZmnToEs(path = "operateList", type = ZmnEsFieldType.InNested)
    private OrderWorkOperateQuery operate;

    /**
     * 支付状态
     *
     * @see PayConsts#getPayStatusName(int)
     */
    @ZmnToEs(map = "payStatus", type = ZmnEsFieldType.Integer)
    private Integer payStatus;

    /**
     * 支付状态
     *
     * @see PayConsts#getPayStatusName(int)
     */
    @ZmnToEs(map = "payStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> payStatusList;

    /**
     * 是否有预付款  1 no 2 yes
     */
    @ZmnToEs(map = "hasChannelPrepayAmount", type = ZmnEsFieldType.Boolean)
    private Integer hasPrepayAmount;

    /**
     * 取消人Id
     */
    @ZmnToEs(map = "cancelerId", type = ZmnEsFieldType.Long)
    private Long cancelerId;

    /**
     * 取消人类型
     */
    @ZmnToEs(map = "cancelerType", type = ZmnEsFieldType.Integer)
    private Integer cancelerType;

    /**
     * 取消人类型
     */
    @ZmnToEs(map = "cancelerType", type = ZmnEsFieldType.Arr)
    private List<Integer> cancelerTypes;
    @ZmnToEs(map = "cancelerType", type = ZmnEsFieldType.Arr)
    private List<Integer> cancelerTypeList;

    /**
     * 工单号code
     */
    @ZmnToEs(map = "id", type = ZmnEsFieldType.Long)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long code;

    /**
     * 工单号后六位
     */
    @ZmnToEs(map = "codeEnd6", type = ZmnEsFieldType.Text)
    private String codeEnd6;

    /**
     * 渠道单号
     */
    @ZmnToEs(map = {"outerId", "extOuterId"}, type = ZmnEsFieldType.Or)
    private String outerId;

    /**
     * 源单号
     */
    @ZmnToEs(map = {"originalId"}, type = ZmnEsFieldType.Or)
    private Long originalId;

    /**
     * 返修单Id
     */
    @ZmnToEs(map = "reworkId", type = ZmnEsFieldType.Long)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long reworkId;

    /**
     * 配件报销状态
     */
    @ZmnToEs(map = "partReimburseStatus", type = ZmnEsFieldType.Integer)
    private Integer partReimburseStatus;

    /**
     * 失败/取消原因Id
     */
    @ZmnToEs(map = "failMapIdList", type = ZmnEsFieldType.Arr)
    private List<Integer> failMapIdList;

    /**
     * 子公司Id集合
     */
    // @ZmnToEs(map = {"companyId", "gridCompanyId"}, type = ZmnEsFieldType.Or)
    private List<Integer> companyIdOrGridCompanyIdList;

    /**
     * 服务公司Id
     */
    // @ZmnToEs(map = {"manageCompanyId", "gridManageCompanyId"}, type = ZmnEsFieldType.Or)
    private Integer manageCompanyIdOrGridManageCompanyId;

    /**
     * 服务公司Id集合
     */
    // @ZmnToEs(map = {"manageCompanyId", "gridManageCompanyId"}, type = ZmnEsFieldType.Or)
    private List<Integer> manageCompanyIdOrGridManageCompanyIdList;

    /**
     * 子公司Id
     */
    @ZmnToEs(map = "companyId", type = ZmnEsFieldType.Integer)
    private Integer companyId;

    /**
     * 子公司Id集合
     */
    @ZmnToEs(map = "companyId", type = ZmnEsFieldType.Arr)
    private List<Integer> companyIdList;

    /**
     * 行政子公司Id集合
     */
    @ZmnToEs(map = "gridCompanyId", type = ZmnEsFieldType.Arr)
    private List<Integer> gridCompanyIdList;

    /**
     * 服务公司Id集合
     */
    @ZmnToEs(map = "manageCompanyId", type = ZmnEsFieldType.Arr)
    private List<Integer> manageCompanyIdList;

    /**
     * 服务公司Id
     */
    @ZmnToEs(map = "manageCompanyId", type = ZmnEsFieldType.Integer)
    private Integer manageCompanyId;

    /**
     * 行政服务公司Id
     */
    @ZmnToEs(map = "gridManageCompanyId", type = ZmnEsFieldType.Integer)
    private Integer gridManageCompanyId;

    /**
     * 行政服务公司Id
     */
    @ZmnToEs(map = "gridManageCompanyId", type = ZmnEsFieldType.Arr)
    private List<Integer> gridManageCompanyIdList;

    /**
     * 厂商Id (厂商)
     */
    @ZmnToEs(map = "factoryOrder.factoryId", type = ZmnEsFieldType.Arr)
    private List<Integer> factoryIdList;
    /**
     * 厂商Id (厂商)
     */
    @ZmnToEs(map = "factoryOrder.factoryId", type = ZmnEsFieldType.Integer)
    private Integer factoryId;

    /**
     * 配件类型 (厂商配件)
     */
    @ZmnToEs(map = "factoryOrder.partType", type = ZmnEsFieldType.Integer)
    private Integer partType;

    /**
     * 配件审核状态 (厂商配件)
     */
    @ZmnToEs(map = "factoryOrder.partReviewStatus", type = ZmnEsFieldType.Integer)
    private Integer partReviewStatus;

    /**
     * 配件审核状态 (厂商配件)
     */
    @ZmnToEs(map = "factoryOrder.partReviewStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> partReviewStatusList;

    /**
     * 邮寄状态(厂商配件)
     */
    @ZmnToEs(map = "factoryPartPostList.postStatus", path = "factoryPartPostList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Integer)
    private Integer postStatus;

    /**
     * 邮寄状态(厂商配件)
     */
    @ZmnToEs(map = "factoryPartPostList.postStatus", path = "factoryPartPostList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Arr)
    private List<Integer> postStatusList;

    /**
     * 不在邮寄状态列表的(厂商配件)
     */
    @ZmnToEs(map = "factoryOrder.postStatus",  type = ZmnEsFieldType.NotInArr)
    private List<Integer> notPostStatusList;

    /**
     * 是否存在配件邮寄状态
     * 1 否 2 是
     */
    @ZmnToEs(map = "factoryOrder.postStatus",  type = ZmnEsFieldType.Exist)
    private Integer existPostStatus;

    /**
     * 配件类型 (厂商配件)
     * 1 否 2 是
     */
    @ZmnToEs(map = "factoryOrder.partSrc", type = ZmnEsFieldType.Exist)
    private Integer existPartSrc;

    /**
     * 邮寄类型(厂商配件)
     */
    @ZmnToEs(map = "factoryPartPostList.postType", path = "factoryPartPostList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Integer)
    private Integer postType;

    /**
     * 邮寄类型(厂商配件)
     */
    @ZmnToEs(map = "factoryPartPostList.postType", path = "factoryPartPostList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Arr)
    private List<Integer> postTypeList;

    /**
     * 厂商邮寄
     */
    @ZmnToEs(path = "factoryPartPostList", type = ZmnEsFieldType.InNested)
    private OrderWorkFactoryPartPostQuery partPostList;

    /**
     *
     * 收费level
     */
    @ZmnToEs(map = "totalAmount", type = ZmnEsFieldType.AmountLevel)
    private Integer amountLevel;

    /**
     * 订单收入金额范围
     */
    @ZmnToEs(map = "totalAmount", type = ZmnEsFieldType.IntegerRange)
    private String totalAmountRange;

    /**
     *
     * 价格类型（服务项类型：1.工单服务项 2.故障服务项）
     */
    @ZmnToEs(map = "servItemType", type = ZmnEsFieldType.Integer)
    private Integer servItemType;

    /**
     *
     * 计价器工单是否有效 1否 2是
     */
    @ZmnToEs(map = "isQuotationValid", type = ZmnEsFieldType.Boolean)
    private Integer isQuotationValid;

    /**
     *
     * 是否存在有效计价器
     */
    @ZmnToEs(map = "isQuotationValid", type = ZmnEsFieldType.Exist)
    private Integer existQuotationValid;

    /**
     *
     * 报价人类型
     */
    @ZmnToEs(map = "quotationType", type = ZmnEsFieldType.Integer)
    private Integer quotationType;

    /**
     * 参与报价人
     */
    @ZmnToEs(map = "partakeQuotationTypeList", type = ZmnEsFieldType.Arr)
    private List<Integer> partakeQuotationTypeList;

    /**
     * 首次报价人类型 1：系统 2：员工 3：工程师 4：用户 5：厂商 6：服务商 7：大客户 8：渠道
     * @See GlobalConsts.OPERATE_USER_TYPE_*
     */
    @ZmnToEs(map = "firstQuotationType", type = ZmnEsFieldType.Integer)
    private Integer firstQuotationType;

    /**
     * 首次报价人id
     */
    @ZmnToEs(map = "firstQuotationId", type = ZmnEsFieldType.Long)
    private Long firstQuotationId;

    /**
     * 一级渠道id list
     */
    @ZmnToEs(map = "channelTwoId", type = ZmnEsFieldType.Arr)
    private List<Integer> channelTwoIdList;

    /**
     * 渠道id list
     */
    @ZmnToEs(map = "channelId", type = ZmnEsFieldType.Arr)
    private List<Integer> channelIdList;

    /**
     * 来源渠道id list
     */
    @ZmnToEs(map = "sourceChannelId", type = ZmnEsFieldType.Arr)
    private List<Integer> sourceChannelIdList;

    /**
     * 一级渠道id list
     */
    @ZmnToEs(map = "sourceChannelTwoId", type = ZmnEsFieldType.Arr)
    private List<Integer> sourceChannelTwoIdList;

    /**
     * 优惠
     */
    @ZmnToEs(path = "discountList", type = ZmnEsFieldType.InNested)
    private OrderWorkDiscountQuery discount;

    /**
     * 是否有投诉  1 no 2 yes
     */
    @ZmnToEs(map = "complaintStatus", type = ZmnEsFieldType.Integer)
    private Integer complaintStatus;

    /**
     * 推荐人id
     */
    @ZmnToEs(map = "recommenderId", type = ZmnEsFieldType.Long)
    private Long recommenderId;

    /**
     * 推荐人类型
     */
    @ZmnToEs(map = "recommenderType", type = ZmnEsFieldType.Integer)
    private Long recommenderType;

    /**
     * 接单时间
     */
    @ZmnToEs(map = "receiveTime", type = ZmnEsFieldType.Date)
    private String receiveTime;

    /**
     * 接单时间
     */
    @ZmnToEs(map = "assignConfirmTime", type = ZmnEsFieldType.Date)
    private String assignConfirmTime;

    /**
     * 接单时间
     * 1否2是
     */
    @ZmnToEs(map = "assignConfirmTime", type = ZmnEsFieldType.Exist)
    private Integer existAssignConfirmTime;

    /**
     * 下单时间
     */
    @ZmnToEs(map = "inputTime", type = ZmnEsFieldType.Date)
    private String inputTime;

    /**
     * 预约时间
     */
    @ZmnToEs(map = "dutyTime", type = ZmnEsFieldType.Date)
    private String dutyTime;

    /**
     * 预约时间
     * 1否2是
     */
    @ZmnToEs(map = "dutyTime", type = ZmnEsFieldType.Exist)
    private Integer existDutyTime;

    /**
     * 挂起时间
     */
    @ZmnToEs(map = "suspendTime", type = ZmnEsFieldType.Date)
    private String suspendTime;

    /**
     * 下次联系时间
     */
    @ZmnToEs(map = "nextContactTime", type = ZmnEsFieldType.Date)
    private String nextContactTime;

    /**
     * 服务完成时间
     */
    @ZmnToEs(map = "serviceCompleteTime", type = ZmnEsFieldType.Date)
    private String serviceCompleteTime;

    /**
     * 渠道可结算的时间
     */
    @ZmnToEs(map = "channelStatementCanTime", type = ZmnEsFieldType.Date)
    private String channelStatementCanTime;

    /**
     * 是否挂起
     */
    private Integer isDutySuspend;
    private Integer dutySuspendReasonCode;

    /**
     * 是否预约失败
     */
    private Integer isDutyFail;
    private Integer dutyFailReasonCode;

    /**
     * 预约状态
     */
    @ZmnToEs(map = "dutyStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> dutyStatusList;

    /**
     * 预约失败code
     */
    @ZmnToEs(map = "dutyFailCode", type = ZmnEsFieldType.Integer)
    private Integer dutyFailCode;

    /**
     * 派单时间
     */
    @ZmnToEs(map = "distributeTime", type = ZmnEsFieldType.Date)
    private String distributeTime;

    /**
     * 上门时间
     */
    @ZmnToEs(map = "visitTime", type = ZmnEsFieldType.Date)
    private String visitTime;

    /**
     * 评价时间
     */
    @ZmnToEs(map = "commentTime", type = ZmnEsFieldType.Date)
    private String commentTime;

    /**
     * 是否存在评价 1否(未评价)  2 是（已评价）
     */
    @ZmnToEs(map = "commentTime", type = ZmnEsFieldType.Exist)
    private Integer existCommentTime;

    /**
     * 支付时间
     */
    @ZmnToEs(map = "payTime", type = ZmnEsFieldType.Date)
    private String payTime;

    /**
     * 完成时间
     */
    @ZmnToEs(map = "completeTime", type = ZmnEsFieldType.Date)
    private String completeTime;

    /**
     * 完成时间 1否 2是
     */
    @ZmnToEs(map = "completeTime", type = ZmnEsFieldType.Exist)
    private Integer existCompleteTime;

    /**
     * 收单时间
     */
    @ZmnToEs(map = "checkoutTime", type = ZmnEsFieldType.Date)
    private String checkoutTime;

    /**
     * 完成时间 1否 2是
     */
    @ZmnToEs(map = "checkoutTime", type = ZmnEsFieldType.Exist)
    private Integer existCheckoutTime;

    /**
     * 算账时间
     */
    @ZmnToEs(map = "accountTime", type = ZmnEsFieldType.Date)
    private String accountTime;

    /**
     * 服务商结算时间
     */
    @ZmnToEs(map = "spStatementTime", type = ZmnEsFieldType.Date)
    private String spStatementTime;

    /**
     * 回访时间
     */
    @ZmnToEs(map = "replyVisitTime", type = ZmnEsFieldType.Date)
    private String replyVisitTime;

    /**
     * 配件报销时间
     */
    @ZmnToEs(map = "partReimburseTime", type = ZmnEsFieldType.Date)
    private String partReimburseTime;

    /**
     * 退款时间
     */
    @ZmnToEs(map = "lastRefundAmountTime", type = ZmnEsFieldType.Date)
    private String refundAmountTime;

    /**
     * 开发票时间
     */
    @ZmnToEs(map = "invoiceTime", type = ZmnEsFieldType.Date)
    private String invoiceTime;

    /**
     * 领单时间
     */
    @ZmnToEs(map = "takeTime", type = ZmnEsFieldType.Date)
    private String takerTime;

    /**
     * 取消时间
     */
    @ZmnToEs(map = "cancelTime", type = ZmnEsFieldType.Date)
    private String cancelTime;

    /**
     * 签到时间
     */
    @ZmnToEs(map = "signInTime", type = ZmnEsFieldType.Date)
    private String signInTime;

    /**
     * 最后一次上门扫码时间
     */
    @ZmnToEs(map = "lastVisitScanTime", type = ZmnEsFieldType.Date)
    private String lastVisitScanTime;

    /**
     * 签到状态（仅用于天猫勤鸽订单）
     */
    @ZmnToEs(map = "signInStatus", type = ZmnEsFieldType.Integer)
    private Integer signInStatus;

    /**
     * 核销时间
     */
    @ZmnToEs(map = "verificationTime", type = ZmnEsFieldType.Date)
    private String verificationTime;

    /**
     * 签收时间
     */
    @ZmnToEs(map = "signForTime", type = ZmnEsFieldType.Date)
    private String signForTime;

    /**
     * 最大保修过期时间
     */
    @ZmnToEs(map = "warrantyProductMaxExpiredTime", type = ZmnEsFieldType.Date)
    private String warrantyProductMaxExpiredTime;

    /**
     * 工单结果状态
     */
    @ZmnToEs(map = "resultStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> resultStatusList;

    /**
     * 用户评分
     */
    @ZmnToEs(map = "commentScore", type = ZmnEsFieldType.Integer)
    private Integer commentScore;

    /**
     * 贴花状态
     */
    @ZmnToEs(map = "appliqueStatus", type = ZmnEsFieldType.Integer)
    private Integer appliqueStatus;

    /**
     * 评价是否准时上门
     */
    @ZmnToEs(map = "visitOnTimeStatus", type = ZmnEsFieldType.Integer)
    private Integer visitOnTimeStatus;

    /**
     * 是否是标准收费单
     */
    @ZmnToEs(map = "isStandardPrice", type = ZmnEsFieldType.Boolean)
    private Integer isStandardPrice;

    /**
     * 平台类型 1 下单平台 2 服务平台
     */
    @ZmnToEs(map = "platType", type = ZmnEsFieldType.Integer)
    private Integer platType;

    /**
     * 是否有评分
     * 1否2是
     */
    @ZmnToEs(map = "commentScore", type = ZmnEsFieldType.Exist)
    private Integer existCommentScore;

    /**
     * 接单员Id集合
     */
    @ZmnToEs(map = "receiverId", type = ZmnEsFieldType.Arr)
    private List<Integer> receiverIdList;

    /**
     * 回访员Id集合
     */
    @ZmnToEs(map = "replyVisiterId", type = ZmnEsFieldType.Arr)
    private List<Integer> replyVisiterIdList;

    /**
     * 上门用户Id
     */
    @ZmnToEs(map = "visitUserId", type = ZmnEsFieldType.Long)
    private Long visitUserId;

    /**
     * 微信公众号扫码用户
     */
    @ZmnToEs(map = "weChatScanUserId", type = ZmnEsFieldType.Long)
    private Long weChatScanUserId;

    /**
     * visitUserIdList
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ZmnToEs(map = "visitUserId", type = ZmnEsFieldType.Arr)
    private List<Long> visitUserIdList;

    /**
     * 上门用户Id
     */
    @ZmnToEs(map = "userId", type = ZmnEsFieldType.NotInArr)
    private List<Long> notUserId;

    /**
     * 是否有配件 1 no 2 yes
     */
    @ZmnToEs(map = "hasPart", type = ZmnEsFieldType.Boolean)
    private Integer partExist;

    /**
     * 是否保留配件申请 1 不保留，2 保留
     */
    @ZmnToEs(map = "partRetain", type = ZmnEsFieldType.Integer)
    private Integer partRetain;

    /**
     * 是否有保修卡 1 no 2 yes
     */
    @ZmnToEs(map = "hasWarrantyCode", type = ZmnEsFieldType.Boolean)
    private Integer hasWarrantyCode;

    /**
     * 退款审核状态
     */
    @ZmnToEs(map = "refundReviewStatus", type = ZmnEsFieldType.Integer)
    private Integer refundReviewStatus;

    /**
     * 是否有远程费
     */
    @ZmnToEs(map = "factoryOrder.hasRemoteAmount", type = ZmnEsFieldType.Boolean)
    private Integer hasRemoteAmount;

    /**
     * 是否有优惠
     */
    @ZmnToEs(map = "discountAmount", type = ZmnEsFieldType.AmountNotExist)
    private Integer hasDiscountAmount;

    /**
     * 店铺Id
     */
    @ZmnToEs(map = "shopOrder.shopId", type = ZmnEsFieldType.Integer)
    private Integer shopId;

    /**
     * 店铺Id
     */
    @ZmnToEs(map = "shopOrder.shopId", type = ZmnEsFieldType.Arr)
    private List<Integer> shopIdList;

    /**
     * 下单平台
     */
    @ZmnToEs(map = "plat", type = ZmnEsFieldType.Integer)
    private Integer plat;

    /**
     * 店铺类型
     */
    @ZmnToEs(map = "shopOrder.shopType", type = ZmnEsFieldType.Integer)
    private Integer shopType;

    /**
     * 来源公司
     */
    @ZmnToEs(map = "sourceCompanyId", type = ZmnEsFieldType.Integer)
    private Integer sourceCompanyId;

    /**
     * 回访类别
     */
    @ZmnToEs(map = "remarkDetailList.category", type = ZmnEsFieldType.Integer)
    private Integer category;

    /**
     * 快递单号
     */
    @ZmnToEs(map = "orderPostList.expressCode", type = ZmnEsFieldType.Text)
    private String orderPostExpressCode;

    /**
     * 快递工单编号
     */
    @ZmnToEs(map = "orderPostList.companyCode", type = ZmnEsFieldType.Text)
    private String orderPostCompanyCode;

    /**
     * 快递状态
     */
    @ZmnToEs(map = "orderPostList.status", type = ZmnEsFieldType.Arr)
    private List<Integer> orderPostStatusList;

    /**
     * 服务商结算状态 1，未结算  2，已结算
     */
    @ZmnToEs(map = "spStatementStatus", type = ZmnEsFieldType.Integer)
    private Integer spStatementStatus;

    /**
     * 服务商结算查询
     */
    private Integer spStatement;

    /**
     * 服务完成审核状态 1.待审核 2. 审核成功 3. 审核失败
     */
    @ZmnToEs(map = "serviceCompleteReviewStatus", type = ZmnEsFieldType.Integer)
    private Integer serviceCompleteReviewStatus;

    /**
     * 改约改派
     */
    private Integer modifyType;

    /**
     * 改约次数
     */
    @ZmnToEs(map = "dutyTimeModifyCount", type = ZmnEsFieldType.IntegerRange)
    private String dutyTimeModifyCountRange;

    /**
     * 改派次数
     */
    @ZmnToEs(map = "distributeModifyCount", type = ZmnEsFieldType.IntegerRange)
    private String distributeModifyCountRange;

    /**
     * 可结算时间 1否 2是
     */
    @ZmnToEs(map = "channelStatementCanTime", type = ZmnEsFieldType.Exist)
    private Integer existChannelStatementCanTime;

    /**
     *  是否待取消（1：否，2：是）
     */
    @ZmnToEs(map = "waitCancel", type = ZmnEsFieldType.NotIn)
    private Integer notWaitCancel;

    /**
     * 预付状态
     */
    @ZmnToEs(map = "prepayStatus", type = ZmnEsFieldType.NotIn)
    private Integer notPrepayStatus;

    /**
     * 用户层级
     */
    private Integer userLevel;

    /**
     * 标签类型
     * @see com.zmn.oms.common.constant.OrderTagConsts#ORDER_TAG_USER_SYSTEM
     */
    @ZmnToEs(map = "orderTagList.tagType", type = ZmnEsFieldType.Integer)
    private Integer tagType;

    /**
     * 标签id
     */
    @ZmnToEs(map = "orderTagList.tagId", type = ZmnEsFieldType.Integer)
    private Integer tagId;

    /**
     * 不包含标签id
     */
    @ZmnToEs(map = "orderTagList.tagId", type = ZmnEsFieldType.NotIn)
    private Integer nonTagId;

    /**
     * 改预付时间 1否2是
     */
    @ZmnToEs(map = "lastPrepayAmountOptTime", type = ZmnEsFieldType.Exist)
    private Integer existLastPrepayAmountOptTime;

    /**
     * 网格id
     */
    @ZmnToEs(map = "gridId", type = ZmnEsFieldType.Arr)
    private List<Integer> gridIdList;

    /**
     * 工单标记ID
     */
    @ZmnToEs(map = "orderTagList.tagId", type = ZmnEsFieldType.Arr)
    private List<Integer> tagIdList;

    /**
     * 上门类型
     */
    @ZmnToEs(map = "orderVisitList.visitType", type = ZmnEsFieldType.Integer)
    private Integer visitType;

    /**
     * 上门类型
     */
    @ZmnToEs(map = "orderVisitList.visitStatus", type = ZmnEsFieldType.Integer)
    private Integer visitStatus;

    /**
     * 测试单
     */
    @ZmnToEs(map = "isTest", type = ZmnEsFieldType.Boolean)
    private Integer test;

    /**
     * 导出任务id
     */
    private Integer exportTaskId;

    /**
     * 是否导出服务项
     */
    private Boolean supportServiceItem;

    /**
     * 商家流水号
     */
    @ZmnToEs(map = "voucherOrderList.payOutTradeNo", path = "voucherOrderList", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Text)
    private String payOutTradeNo;

    /**
     * 退款审核
     */
    @ZmnToEs(map = "refundWorkReviewStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> refundWorkReviewStatusList;

    /**
     * 赔偿审核
     */
    @ZmnToEs(map = "workReviewList.reviewStatus", type = ZmnEsFieldType.Arr)
    private List<Integer> compensateWorkReviewStatusList;

    /**
     * 验收类型 10、定金 11、尾款
     *
     * @see com.zmn.oms.common.constant.OrderConsts#ORDER_ACCEPTANCE_TYPE_PAYMENT
     */
    @ZmnToEs(map = "orderWorkAcceptanceList.acceptanceType", type = ZmnEsFieldType.Integer)
    private Integer acceptanceType;

    /**
     * 验收类型-非
     */
    @ZmnToEs(map = "orderWorkAcceptanceList.acceptanceType", type = ZmnEsFieldType.NotIn)
    private Integer nonAcceptanceType;

    /**
     * 验收结果 1 待验收  2 验收成功  3验收失败
     *
     * @see com.zmn.oms.common.constant.OrderConsts#ORDER_ACCEPTANCE_STATUS_WAIT
     */
    @ZmnToEs(map = "orderWorkAcceptanceList.acceptanceResultStatus", type = ZmnEsFieldType.Integer)
    private Integer acceptanceResultStatus;

    /**
     * 操作者ID
     */
    @ZmnToEs(map = "orderWorkAcceptanceList.operatorId", type = ZmnEsFieldType.Integer)
    private Long acceptanceOperatorId;

    /**
     * 操作人类型
     */
    @ZmnToEs(map = "orderWorkAcceptanceList.operatorType", type = ZmnEsFieldType.Integer)
    private Integer acceptanceOperatorType;

    /**
     * 最后一次操作时间
     */
    @ZmnToEs(map = "orderWorkAcceptanceList.operateTime", type = ZmnEsFieldType.Date)
    private String acceptanceOperateTime;

    /**
     * 照片审核状态
     */
    @ZmnToEs(map = "imageStatus", type = ZmnEsFieldType.Integer)
    private Integer imageStatus;


    /**
     * 退款方式类型
     */
    @ZmnToEs(map = "refundDetail.refundType", path = "refundDetail", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Integer)
    private Integer refundType;

    /**
     * 外报运杂审核，1待审核，2已审核
     */
    @ZmnToEs(map = "orderPartAddition.reviewStatus", path = "orderPartAddition", type = ZmnEsFieldType.Nested, pathType = ZmnEsFieldType.Integer)
    private Integer orderPartReview;

    /**
     * 是否是一口价 1 no 2 yes
     */
    @ZmnToEs(map = "isFinalPrice", type = ZmnEsFieldType.Boolean)
    private Integer finalPrice;
}
